<?
class Paginationlib {
	function __construct() {
		$this -> ci = &get_instance();
	}

	public function initPagination($base_url, $total_rows) {
		$config['per_page'] = 30;
		$page = (isset($_GET['per_page']) && $_GET['per_page']!="") ? $_GET['per_page']:"1";
		$config['start'] = ($page-1)*$config['per_page'];
		$config['limit'] = $config['per_page'];
		$config['uri_segment'] = 3;
		$config['base_url'] = base_url() . $base_url;
		$config['total_rows'] = $total_rows;
		$config['use_page_numbers'] = TRUE;
		$config['page_query_string'] = TRUE;
		$config['first_tag_open'] = $config['last_tag_open'] = $config['next_tag_open'] = $config['prev_tag_open'] = $config['num_tag_open'] = '<li>';
		$config['first_tag_close'] = $config['last_tag_close'] = $config['next_tag_close'] = $config['prev_tag_close'] = $config['num_tag_close'] = '</li>';

		$config['cur_tag_open'] = "<li><a>";
		$config['cur_tag_close'] = "</a></li>";

		$this -> ci -> pagination -> initialize($config);
		return $config;
	}

}
?>